/**
 * 1. Hypertext Transfer Protocol  超文本传输协议
 * 2. Uniform Resource Locator 统一资源定位符
 */

const http = require("http");

// 创建一个 服务
const server = http.createServer((request, response) => {
  response.setHeader("content-type", "charset:utf-8");
  console.log("url", request.url);
  console.log("method", request.method);
  console.log("headers", request.headers);
  response.end("http server");
});

// 监听该服务   该回调会在每次响应http的时候调用
server.listen(9000, () => {
  console.log("服务启动了");
});
